<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改保险')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-INSURANCE-edit" th:object="${iNSURANCE}">
            <input name="insuranceId" th:field="*{insuranceId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">公司名称：</label>
                <div class="col-sm-8">
                    <input name="firmName" th:field="*{firmName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">保险单号：</label>
                <div class="col-sm-8">
                    <input name="insuranceNumber" th:field="*{insuranceNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否学费包含：</label>
                <div class="col-sm-8">
                    <input name="tuitionIn" th:field="*{tuitionIn}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">保险开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="beginTime" th:value="${#dates.format(iNSURANCE.beginTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">保险结束时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="finishTime" th:value="${#dates.format(iNSURANCE.finishTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">学生状态：</label>
                <div class="col-sm-8">
                    <select name="studentState" class="form-control m-b" th:with="type=${@dict.getType('STUDENT')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{studentState}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">保险状态是否到期：</label>
                <div class="col-sm-8">
                    <select name="insuranceState" class="form-control m-b" th:with="type=${@dict.getType('insurance')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{insuranceState}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/INSURANCE";
        $("#form-INSURANCE-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-INSURANCE-edit').serialize());
            }
        }

        $("input[name='beginTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='finishTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>